<template>
	<view>
		<li-statistics @openPopup="openPopup" :fn="fn" :param.sync="param" :pageData.sync="pageData" :isLoaded.sync="isLoaded" :maxRange="7" v-on:afterLoaded="afterLoaded($event)">
			<template #li>
				<block v-if="isLoaded">
					<li-statistics-cards :cd="pageData.cd" />
					<li-statistics-chart v-show="!isShowCanvas" :cd="pageData.personTrend" />
					<li-statistics-chart v-show="!isShowCanvas" :cd="pageData.perAvgComsumeTrend" />
					<li-statistics-chart v-show="!isShowCanvas" :cd="pageData.avgComsumeTrend" />
					<li-statistics-chart v-show="!isShowCanvas" :cd="pageData.ktTrend" />
					<li-statistics-chart v-show="!isShowCanvas" :cd="pageData.szTrend" />
				</block>
			</template>
		</li-statistics>
	</view>
</template>

<script>
import date from '@/utils/date';
import liStatisticsMixin from '../../../mixins/liStatisticsMixin';
import { GetTradeAnalysis } from '../../../common/modules/report';

export default {
	mixins: [liStatisticsMixin],
	data: function () {
		return {
			navTitle: '营业分析',
			fn: GetTradeAnalysis,
			param: {
				dataTimeRange: [date.getDate(-6), date.getToday()]
			}
		};
	},
	methods: {
		afterLoaded(e) {}
	}
};
</script>
